﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Usercontrol_ControlReportNPPRegisterNew : System.Web.UI.UserControl
{
    ClassExecute.ClassExecute dt;
    string str = webapp4U.Configuration.CurrentConnectionString;
    string error = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GetData(Session["UserName"].ToString());
        }
        
    }
    void GetData(string salesp_key)
    {
        GridView1.DataSource = null;
        dt = new ClassExecute.ClassExecute();
        DataTable db = dt.Get_Data_DataTable(str, ref error, "k_getNPPRegisterNew", CommandType.StoredProcedure,
            new SqlParameter("@salesp_key", salesp_key));
        if (db.Rows.Count > 0)
        {
            GridView1.DataSource = db;

        }
        GridView1.DataBind();
    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        GetData(Session["UserName"].ToString());
    }
}